if ( SERVER ) then
	Default( "TotalWaves", 8 )
	
	function GM:SetTotalWaves()
		SetGlobalInt( "IncTotalWaves", self.TotalWaves )
	end
	GM:AddHook( "InitPostEntity", "SetTotalWaves" )
	
	function GM:SetWave()
		// Include build rounds as part of a "wave".
		local wave = self:GetRoundNumber()
		if ( self:IsBuild() ) then wave = wave + 1 end
		
		SetGlobalInt( "IncWave", math.min( wave, self.TotalWaves ) )
	end
	GM:AddHook( "RoundChanged", "SetWave" )
	
end